<template>
    <div>
        <h1>home</h1>
        {{ name }}
        <button @click="chang">++</button>
        {{ age.obj }}
        <button @click="xiu">秀</button>
    </div>
</template>
<script setup> 
import { ref ,reactive} from 'vue'
let name = ref(0)

function chang() {
    if (name.value < 5) {
         name.value++
       
    }else{
        alert('不能大于五')
    }

}

let age= reactive({
    obj:"甜婶"
})
function xiu(){
    age.obj='甜婶甜婶'
}
</script>
<style></style>